package com.wicket.okrcalc.integration.dto;

import com.wicket.okrcalc.common.dto.BaseDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Objects;
import javax.validation.constraints.NotNull;
import lombok.Data;

/**
 * @desc OldestOfMultipleNumDto
 * @使用场景
 */
@Data
public class OldestOfMultipleNumDto extends BaseDto implements Serializable {

  /**
   * 通用主键ID
   */
  @NotNull(message = "通用主键ID不能为空")
  @ApiModelProperty("通用主键ID")
  private String commPrimaryKey;

  /**
   * 通用时间字段
   */
  @NotNull(message = "通用时间字段不能为空")
  @ApiModelProperty("通用时间字段")
  private Date comTimeField;

  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;
    if (!super.equals(o)) return false;
    OldestOfMultipleNumDto that = (OldestOfMultipleNumDto) o;
    return (
      commPrimaryKey == that.commPrimaryKey && comTimeField == that.comTimeField
    );
  }

  @Override
  public int hashCode() {
    return Objects.hash(super.hashCode(), commPrimaryKey, comTimeField);
  }

}
